<%@ Page Language="C#" MasterPageFile="~/app-frame.master" AutoEventWireup="true" CodeFile="DMR.aspx.cs" Inherits="Default2" Title="Untitled Page" %>
<%--><asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
</asp:Content>--%>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder3" Runat="Server">
<script language="JavaScript" type="text/javascript" src="scripts/DMR.js"></script><%--Added by Jayashree on 12-Sep-2014,for js file--%>

    <table id="Table2" border="0" cellpadding="0" cellspacing="0" width="100%">
                        <tr class="pgForm_title">
                        <td align="left" valign="middle">
                            <asp:PlaceHolder ID="ph_page_caption" runat="server"></asp:PlaceHolder>
                            <asp:Label ID="lblHeading" runat="server"></asp:Label></td>
                    </tr>
                </table>
    <asp:Wizard ID="wz_DMR" runat="server" Height="89%" Width="90%" OnFinishButtonClick="wz_DMR_FinishButtonClick"
        ActiveStepIndex="0" OnActiveStepChanged="wz_DMR_ActiveStepChanged" OnCancelButtonClick="wz_DMR_CancelButtonClick"
        OnNextButtonClick="wz_DMR_NextButtonClick" OnPreviousButtonClick="wz_DMR_PreviousButtonClick" 
        CssClass="defaultFont" Font-Size="8pt" DisplayCancelButton="True" >
            <WizardSteps>
                <asp:WizardStep ID="WizardStep1" runat="server" Title="DMR HOME" StepType="Start">
                    <table>
                        <tr>
                            <td style="width: 458px; height: 20px">
                    <table style="width: 100%" border="0">
                    <tr>
                    </tr>
                        <tr>
                            <td colspan="2" style="height: 50px">
                                <asp:Label ID="lblChooseSource" runat="server" CssClass="defaultFont" Font-Bold="True"
                                    Font-Size="10pt" Text="&#160;Step 1: Choose source"></asp:Label>
                            </td>
                        </tr>
                    <tr>
                            <td style="width: 155px; height: 25px;">
                                <asp:Label ID="lblSelect_Table" runat="server" AssociatedControlID="select_table" Text="Select Table"
                                    ToolTip="Select the database table to update" CssClass="controlLabelFont" ForeColor="Black"></asp:Label>
                            </td>
                            <td style="width: 452px; height: 25px;">
                                &nbsp;
                                <asp:DropDownList ID="select_table" runat="server" CssClass="defaultFont" Font-Size="8pt" Width="215px" Height="22px" CausesValidation="True">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 155px; height: 27px;">
                                <asp:Label ID="lblName" runat="server" AssociatedControlID="name" Text="Name"
                                    ToolTip="Name of the DMR" CssClass="controlLabelFont" ForeColor="Black"></asp:Label>
                            </td>
                            <td style="width: 452px; height: 27px;">
                                &nbsp;
                                <asp:TextBox ID="name" runat="server" CssClass="controlFont" Width="215px" Height="22px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 155px; height: 24px;">
                                <asp:Label ID="lblCategory" runat="server" AssociatedControlID="category" Text="Category"
                                    ToolTip="Select the category" CssClass="controlLabelFont" ForeColor="Black"></asp:Label>
                            </td>
                            <td style="width: 452px; height: 24px;">
                                &nbsp;
                                <asp:DropDownList ID="category" runat="server" CssClass="defaultFont" Font-Size="8pt" Width="215px" Height="22px">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 155px; height: 56px;">
                                <asp:Label ID="lblDescription" runat="server" AssociatedControlID="description" Text="Description" CssClass="controlLabelFont" ForeColor="Black"></asp:Label>
                            </td>
                            <td style="width: 452px; height: 56px;">
                                &nbsp;
                                <asp:TextBox ID="description" runat="server" CssClass="controlFont" Height="44px" Width="330px" TextMode="MultiLine" ></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 155px; height: 56px;">
                                <asp:Label ID="lblUpdate_Grouping" runat="server" Text="Update_Grouping" AssociatedControlID="update_grouping" CssClass="controlLabelFont" ForeColor="Black"></asp:Label>
                            </td>
                            <td style="width: 452px; height: 56px;">
                                &nbsp;
                                <asp:TextBox ID="update_grouping" runat="server" CssClass="controlFont" Height="44px" Width="330px" OnTextChanged="txtUpdate_Grouping_TextChanged" TextMode="MultiLine"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 458px; height: 72px;">
                                <table>
                        <tr>
                            <td style="width: 279px">
                                <asp:Label ID="lblAction" runat="server" Text="Action" CssClass="controlLabelFont" ForeColor="Black"></asp:Label>
                            </td>
                            <td style="width: 94px">
                                <asp:RadioButton ID="rbList" runat="server" Text="List" GroupName="Type of Action" CssClass="controlFont" />
                            </td>
                            <td style="width: 125px">
                                <asp:RadioButton ID="rbUpdate" runat="server" Text="Update" GroupName="Type of Action" CssClass="controlFont"  />
                            </td>
                            <td style="width: 115px">
                                &nbsp;<asp:RadioButton ID="rbCreate" runat="server" Text="Create" CssClass="controlFont" Enabled="False" />
                            </td>
                            <td style="width: 106px">
                                <asp:RadioButton ID="rbDelete" runat="server" Text="Delete" CssClass="controlFont" Enabled="False" />
                            </td>
                        </tr>
                    </table>
                                <asp:Label ID="lblMessage" runat="server" ForeColor="#C04000" CssClass="controlFont"></asp:Label>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="select_table"
                                    CssClass="controlFont" Display="Dynamic" ErrorMessage="Select the table from the list"
                                    SetFocusOnError="True"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                    </table>
                    
                                
                                        <%-- <td style="width: 150px">
                                <asp:Button ID="btNext" runat="server" Text="Next" OnClick="Next_Click" CssClass="defaultFont"  />
                                        </td>
                                        <td style="width: 146px">
                                <asp:Button ID="btCancel" runat="server" Text="Cancel" OnClick="Cancel_Click" CssClass="defaultFont" />
                                        </td> --%>
                </asp:WizardStep>
                <asp:WizardStep ID="WizardStep2" runat="server" Title="LIST" StepType="Step">
                    List Radio Option</asp:WizardStep>
                <asp:WizardStep ID="Step3" runat="server" StepType="Step" Title="UPDATE">
                    <table>
                        <tr>
                            <td style="width: 100px; height: 17px;">
                            <asp:Label ID="Step2" runat="server" CssClass="defaultFont" Font-Bold="True"
                                    Font-Size="10pt" Text="&#160;Step 2: Select records that fit this criteria:" Width="300px" ></asp:Label>
                                <br />
                                <asp:Label ID="lblMessage1" runat="server" ForeColor="Red" CssClass="controlFont" Height="20px" Width="200px"></asp:Label>
                                </td>
                        </tr>
                        <tr>
                            <td style="width: 654px; height: 40px;">
                    <table width="100%">
                        <tr>
                            <td style="width: 128px; height: 20px;">
                                <asp:Label ID="lblColumn_Name" runat="server" Text="Column Name" AssociatedControlID="Column_Name" CssClass="controlLabelFont" ForeColor="Black" Height="20px" Width="128px"></asp:Label>
                            </td>
                            <td style="width: 128px; height: 20px;">
                                &nbsp;<asp:Label ID="lblCondition" runat="server" Text="Condition " AssociatedControlID="cmbCondition" CssClass="controlLabelFont" ForeColor="Black" Height="20px" Width="128px"></asp:Label>
                            </td>
                            <td style="width: 128px; height: 20px;">
                                <asp:Label ID="lblValue" runat="server" Text="Value" AssociatedControlID="cmbValue" CssClass="controlLabelFont" ForeColor="Black" Width="128px" Height="20px"></asp:Label>
                            </td>
                            <td style="width: 85px; height: 20px;">
                                <asp:Label ID="lblOperator" runat="server" Text="Operator" CssClass="controlLabelFont" ForeColor="Black" Width="85px" Height="20px"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 128px; height: 20px;">
                                <asp:DropDownList ID="Column_Name" runat="server" AutoPostBack="True" OnSelectedIndexChanged="cmb_SelectedIndexChanged" Width="128px" CssClass="controlFont" Height="20px">
                                </asp:DropDownList>
                            </td>
                            <td style="width: 128px; height: 20px;">
                                <asp:DropDownList ID="cmbCondition" runat="server" CssClass="controlFont" Width="128px" Height="20px" >
                                <%--<asp:ListItem>Equals</asp:ListItem>
                                    <asp:ListItem>Does not equals</asp:ListItem>
                                    <asp:ListItem>is greater than</asp:ListItem>
                                    <asp:ListItem>is greater than or equal too</asp:ListItem>
                                    <asp:ListItem>is less than</asp:ListItem>
                                    <asp:ListItem>is less than or equal to</asp:ListItem>
                                    <asp:ListItem>is one of</asp:ListItem>
                                    <asp:ListItem>is not one of</asp:ListItem>
                                    <asp:ListItem>is betwen</asp:ListItem>
                                    <asp:ListItem>is not between</asp:ListItem>
                                    <asp:ListItem>begins with</asp:ListItem>
                                    <asp:ListItem>does not begin with</asp:ListItem>
                                    <asp:ListItem>ends with</asp:ListItem>
                                    <asp:ListItem>does not end with</asp:ListItem>
                                    <asp:ListItem>contains</asp:ListItem>
                                    <asp:ListItem>does not contain</asp:ListItem>
                                    <asp:ListItem>Like</asp:ListItem>
                                    <asp:ListItem>not like</asp:ListItem>
                                    <asp:ListItem>is null</asp:ListItem>
                                    <asp:ListItem>is not null</asp:ListItem>--%>
                                </asp:DropDownList>
                            </td>
                            <td style="width: 128px; height: 20px;">
                                <asp:DropDownList ID="cmbValue" runat="server" CssClass="controlFont" Width="128px" Height="20px">
                                </asp:DropDownList>
                            </td>
                            <td style="width: 85px; height: 20px;">
                                <asp:RadioButton ID="rbAND" runat="server" CssClass="controlFont" Text="AND" Height="20px" Width="45px" GroupName="Operator" />
                                <asp:RadioButton ID="rbOR" runat="server" CssClass="controlFont" Text="OR" Height="20px" Width="40px" GroupName="Operator" />
                                <br />
                                &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
                                </td>
                            <td style="width: 128px; height: 20px">
                                <asp:Button ID="btAdd" runat="server" Text="Add" CssClass="controlFont" Width="50px" CausesValidation="True" OnClick="btAdd_Click" OnClientClick="javascript:return validateSelFields();"/>
                            </td>
                        </tr>
                    </table>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 100px; height: 21px;">
                                &nbsp;<asp:PlaceHolder ID="phGridSelect" runat="server"></asp:PlaceHolder>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 100px">
                    <asp:GridView ID="gridSelect" runat="server"  Width="550px" CssClass="controlFont" CellPadding="4" ForeColor="#333333" AutoGenerateColumns="False" OnRowDeleting="gridSelect_OnRowDeleting" ShowFooter="True" >
                        <Columns>
                          <%----%> <asp:BoundField DataField="No" HeaderText="No" SortExpression="No"/>
                            <asp:BoundField DataField="Column_Name" HeaderText="Column_Name" SortExpression="Column Name" />
                            <asp:BoundField DataField="Condition" HeaderText="Condition" SortExpression="Condition" />
                            <asp:BoundField DataField="Value" HeaderText="Value" SortExpression="Value" />
                            <asp:BoundField DataField="Operator" HeaderText="Operator" SortExpression="Operator" /> 
                            <asp:ButtonField ButtonType="Button" CommandName="Delete" HeaderText="Delete" ShowHeader="True" 
                                Text="X" />
                        </Columns>
                        <AlternatingRowStyle BackColor="White" />
                        <EditRowStyle BackColor="#2461BF" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    </asp:GridView>
                               <%-- <br />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="Column_Name"
                                    CssClass="controlFont" Display="Dynamic" ErrorMessage="Select the column from the list" Height="20px" Width="200px"></asp:RequiredFieldValidator>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="cmbCondition"
                                    CssClass="controlFont" Display="Dynamic" ErrorMessage="Select the condition from the list" Height="20px" Width="200px"></asp:RequiredFieldValidator>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="cmbValue"
                                    CssClass="controlFont" Display="Dynamic" ErrorMessage="Select the value from the list" Height="20px" Width="200px"></asp:RequiredFieldValidator>--%> 
                            </td>
                        </tr>
                        <tr>
                            <td rowspan="2" style="width: 100px">
                    <table>
                        <tr>
                            <td style="width: 55px; height: 20px;">
                                <asp:Label ID="lblGrouping" runat="server" Text="Grouping" CssClass="defaultFont" Width="55px" Font-Bold="True" Font-Size="Small" Height="20px"></asp:Label>
                            </td>
                            <td style="width: 454px; height: 20px;">
                                <asp:TextBox ID="txtGrouping" runat="server" Width="454px" CssClass="controlFont" Height="20px"></asp:TextBox>
                            </td>
                            <td style="width: 50px; height: 20px;">
                                <asp:Button ID="btTest" runat="server" Text="Test" CssClass="controlFont" Width="50px" Height="20px" />
                            </td>
                        </tr>
                    </table>
                                &nbsp;
                    <asp:Label ID="LblConstMsg" runat="server" Text="Please use the above textbox to apply grouping to the expression using brackets." Width="497px" CssClass="controlFont"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                        </tr>
                        <tr>
                            <td style="width: 100px; height: 59px;">
                                <br />
                                <br />
                                <asp:Label ID="lblmsgconst" runat="server" CssClass="defaultFont" Text="Set the values" Font-Bold="True" Font-Size="Small"></asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 100px; height: 68px;">
                    <table style="width: 500px; height: 15px">
                        <tr>
                            <td style="width: 230px; height: 20px;" align="center">
                                &nbsp;<asp:DropDownList ID="cmbConditionSet" runat="server" Width="230px" CssClass="controlFont" Height="20px">
                                </asp:DropDownList>
                                &nbsp;
                            </td>
                            <td style="width: 50px; height: 20px;" align="center">
                                <asp:Button ID="btEqualTo" runat="server" Text="=" CssClass="controlFont"  Width="50px" Height="20px" />
                            </td>
                            <td style="width: 230px; height: 20px;" align="center">
                                <asp:TextBox ID="txtValueSet" runat="server" CssClass="controlFont" Width="230px" Height="20px" ></asp:TextBox>
                            </td>
                            <td style="width: 50px; height: 20px;" align="center">
                                <asp:Button ID="btAddSet" runat="server" Text="Add" CssClass="controlFont" Width="50px" Height="20px" OnClick="btAddSet_Click" OnClientClick="javascript:return validateSelselFields();"/>
                            </td>
                        </tr>
                    </table>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 100px; height: 22px;">
                                &nbsp;<asp:PlaceHolder ID="phGridSet" runat="server"></asp:PlaceHolder>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 100px">
                    <asp:GridView ID="gridSet" runat="server"  Width="550px" CssClass="controlFont" CellPadding="4" ForeColor="#333333" AutoGenerateColumns="False" OnRowDeleting="gridSet_OnRowDeleting" >
                       <%----%>
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:BoundField DataField="No" HeaderText="No" SortExpression="No"/>
                            <asp:BoundField DataField="Column_Name" HeaderText="Column_Name" SortExpression="Column_Name" />
                            <asp:BoundField DataField="Value" HeaderText="Value" SortExpression="Value" />
                            <asp:ButtonField ButtonType="Button" CommandName="Delete" HeaderText="Delete" ShowHeader="True" 
                                Text="X" />
                        </Columns>
                        <EditRowStyle BackColor="#2461BF" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 100px">
          
                            </td>
                        </tr>
                    </table>
                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                    &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</asp:WizardStep>
                <asp:WizardStep ID="Step4" runat="server" StepType="Step" Title="CREATE">
                    Create Radio Option</asp:WizardStep>
                <asp:WizardStep ID="Step5" runat="server" StepType="Finish" Title="DELETE">
                    Delete Radio Option</asp:WizardStep>
            </WizardSteps>
            <StartNavigationTemplate>
            <asp:Button ID="btCancel" runat="server" Text="Cancel" OnClick="wz_DMR_CancelButtonClick" CssClass="defaultFont"  />
            <asp:Button ID="btSave" runat="server" Text="Save" OnClick="Save_Click" CssClass="defaultFont"  />
                <asp:Button ID="StartNextButton" runat="server" CommandName="MoveNext" CssClass="defaultFont"
                    Text="Next" CausesValidation="True" OnClientClick="javascript:return validateFields();"/>
            </StartNavigationTemplate>
        <HeaderStyle CssClass="controlFont" />
        <StepNavigationTemplate>
            <asp:Button ID="StepPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious"
                Text="Previous" />
             <asp:Button ID="SaveButton" runat="server" CommandName="Save" Text="Save" OnClick="SaveButton_Click"  />
            <asp:Button ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                Text="Cancel" />
                <asp:Button ID="StepNextButton" runat="server" CommandName="MoveNext" Text="Next" />
        </StepNavigationTemplate>
        </asp:Wizard>
        
</asp:Content>

